package com.shine.chemicalWholeProcessSystem.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.google.android.material.snackbar.Snackbar;
import com.shine.chemicalWholeProcessSystem.BR;
import com.shine.chemicalWholeProcessSystem.R;
import com.shine.chemicalWholeProcessSystem.base.BaseActivity;
import com.shine.chemicalWholeProcessSystem.databinding.ActivityViewPageBinding;
import com.shine.chemicalWholeProcessSystem.ui.main.SectionsPagerAdapter;
import com.shine.chemicalWholeProcessSystem.ui.viewModel.ViewPageViewModel;

public class ViewPageActivity extends BaseActivity<ActivityViewPageBinding, ViewPageViewModel> {


    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_view_page;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public ViewPageViewModel initViewModel() {
        return new ViewPageViewModel(this);
    }

    @Override
    public void initData() {
        super.initData();

        initTitle(this, "");


        SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());
        binding.viewPager.setAdapter(sectionsPagerAdapter);
        binding.tabs.setupWithViewPager(binding.viewPager);

        binding.fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            default:
                break;
        }
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            switch (requestCode) {
                default:
                    break;
            }
        }
    }
}
